package io.renren.common.utils;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import io.renren.modules.sys.controller.AbstractController;

import java.util.Date;

//根据时间生成编号
public class FastIDUtil{

    public static String fastId(){
        String year = Integer.valueOf(DateUtil.year(new Date())).toString();
        String month = Integer.valueOf(DateUtil.month(new Date())).toString();
        String day = Integer.valueOf(DateUtil.dayOfMonth(new Date())).toString();
        String hour = Integer.valueOf(DateUtil.hour(new Date(),true)).toString();
        String minute = Integer.valueOf(DateUtil.minute(new Date())).toString();
        String second = Integer.valueOf(DateUtil.second(new Date())).toString();
        String millSecond = Integer.valueOf(DateUtil.millsecond(new Date())).toString();
        String randomNumbers = RandomUtil.randomNumbers(3);
        return year+month+day+hour+minute+second+millSecond+randomNumbers;
    }
}
